#ifndef _IM_SERVER_GROUP_SERVICE_HANDLER_
#define _IM_SERVER_GROUP_SERVICE_HANDLER_

#include "GroupService_types.h"
#include "GroupService.h"
#include "database/simple_db_pool.h"
#include "base/logging.h"
#include "group_id_creator.h"
#include "melon/service/service_arch.h"
#include "melon/service/base_service_impl.h"

namespace imserver {

class GroupServiceHandler : public GroupServiceIf, public melon::service::BaseServiceImpl {
public:
  GroupServiceHandler() {}

  virtual int64_t CreateGroup(const GroupInfo& group_info);
  virtual bool AddGroupTags(int64_t group_id, const std::set<std::string>& tags);
  virtual bool DelGroupTags(int64_t group_id, const std::set<std::string>& tags);
  virtual void GetGroupInfo(GroupInfo& group_info, int64_t group_id);
  virtual void GetGroupInfoByEntityId(GroupInfo& group_info, int32_t type, int64_t entity_id);
  virtual bool UpdateGroupInfo(const GroupInfo& group_info);
  virtual void GetGroupMemberIds(std::set<int64_t>& ret_, int64_t group_id);
  virtual void GetJoinedGroupIds(std::set<int64_t>& ret_, int64_t uid);
  virtual bool JoinInGroup(int64_t group_id, int64_t uid);
  virtual bool QuitFromGroup(int64_t group_id, int64_t uid);
  virtual bool SetMemberStatus(int64_t group_id, int64_t uid, int32_t status);

};

}

#endif // _IM_SERVER_GROUP_SERVICE_HANDLER_
